<extend name="Public:base" />
<block name="content">
<div class="row-fluid">

	<div class="span12">
		
            <div class="color-panel hidden-phone">

                <div class="color-mode-icons icon-color"></div>

                <div class="color-mode-icons icon-color-close" style="display: none;"></div>

                <div class="color-mode" style="display: none;">

                    <p>THEME COLOR</p>

                    <ul class="inline">

                        <li class="color-black color-default current" data-style="default"></li>

                        <li class="color-blue" data-style="blue"></li>

                        <li class="color-brown" data-style="brown"></li>

                        <li class="color-purple" data-style="purple"></li>

                        <li class="color-grey" data-style="grey"></li>

                        <li class="color-white color-light" data-style="light"></li>

                    </ul>

                    <label>

                        <span>Layout</span>

                        <select class="layout-option m-wrap small">

                            <option value="fluid" selected="">Fluid</option>

                            <option value="boxed">Boxed</option>

                        </select>

                    </label>

                    <label>

                        <span>Header</span>

                        <select class="header-option m-wrap small">

                            <option value="fixed" selected="">Fixed</option>

                            <option value="default">Default</option>

                        </select>

                    </label>

                    <label>

                        <span>Sidebar</span>

                        <select class="sidebar-option m-wrap small">

                            <option value="fixed">Fixed</option>

                            <option value="default" selected="">Default</option>

                        </select>

                    </label>

                    <label>

                        <span>Footer</span>

                        <select class="footer-option m-wrap small">

                            <option value="fixed">Fixed</option>

                            <option value="default" selected="">Default</option>

                        </select>

                    </label>

                </div>

            </div>

		<h3 class="page-title">

			轮播图

			 <small>轮播图管理和更多</small>

		</h3>

		<ul class="breadcrumb">

			<li>

				<i class="icon-home"></i>

				<a href="index.html">首页</a> 

				<span class="icon-angle-right"></span>

			</li>

			<li>

				<a href="/admin/lunbo/lunbo/index">轮播图管理</a>

				<span class="icon-angle-right"></span>

			</li>

			<li><a href="/admin/lunbo/lunbo/add">轮播图添加</a></li>

		</ul>

	</div>

</div>
<div class="row-fluid">

	<div class="span12">

		<!-- BEGIN SAMPLE FORM PORTLET-->   

		<div class="portlet box blue">

			<div class="portlet-title">

				<div class="caption"><i class="icon-reorder"></i>轮播图添加</div>

			</div>

			<div class="portlet-body form">

				<!-- BEGIN FORM-->

				<form action="/admin/lunbo/lunbo/insert" method="post" enctype='multipart/form-data' class="form-horizontal">
					<div class="control-group">

						<label class="control-label">轮播图标题</label>

						<div class="controls">

							<input style="width:210px" name="title" type="text" class="span6 m-wrap tooltips" data-trigger="hover" data-original-title="请输入文章的标题" data-placement="top">

							<span  style="line-height:25px" >&nbsp;</span>                 

						</div>

					</div>

					
					<div class="control-group">

						<label class="control-label">轮播图选择</label>

						<div class="controls">

							<div class="fileupload fileupload-new" data-provides="fileupload">

								<div class="fileupload-new thumbnail" style="width: 200px; height: 150px;">

									<!-- <img src="media/image/AAAAAA&amp;text=no+image" alt=""> -->
									<img src="__PUBLIC__/admin/image/animated-overlay.gif" style="width: 200px; height: 150px;" alt=""><span style="line-height:50px; border:1px solid red">  &nbsp;</span> 

								</div>

								<div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>

								<div>

									<span class="btn btn-file"><span class="fileupload-new">Select image</span>

									<span class="fileupload-exists">Change</span>

									<input name="pic" type="file" class="default"></span>

									<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>

								</div>

							</div>

						</div>

					</div>
				
					

					<div class="control-group">

						<label class="control-label">轮播图状态</label>

						<div class="controls">

							<select name="status" class="small m-wrap" tabindex="1">

								<option value="">Select...</option>

								<option value="1">显示</option>

								<option value="0">不显示</option>

							</select>
							<span  style="line-height:25px" >&nbsp;</span>  

						</div>

					</div>


					<div class="control-group">

						<label class="control-label">轮播图位置</label>

						<div class="controls">

							<select name="auth" class="small m-wrap" tabindex="1">

								<option value="">Select...</option>

								<option value="0">商城</option>

								<option value="1">Blog</option>

							</select>
							<span  style="line-height:25px" >&nbsp;</span>  

						</div>

					</div>

					<div class="control-group">

						<label class="control-label"></label>

						<div class="controls">

							<a class="btn yellow" href="#form_modal1" data-toggle="modal">

							设置时间<i class="icon-share"></i>

							</a>  
							<span name="c_time" style="line-height:25px" >&nbsp;</span>   

						</div>

					</div>
					<input type="hidden" value="" name="c_time"></input>

					<div class="form-actions">

						<!-- <input type="submit" value="submit" class="btn blue"> -->

						<button name="submit" type="submit" class="btn blue">submit</button>                            
						<button name="cancel" type="button" class="btn">Cancel</button>                            

					</div>

				</form>
					
					<div name="riqi" class="modal-scrollable" style="z-index: 10050;display:none">
						<div id="form_modal1" class="modal hide fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="false" style="display: block; margin-top: -152px;">

							<div class="modal-header">

								<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

								<h3 id="myModalLabel1">获取时间</h3>

							</div>

							<div class="modal-body">

								<form action="#" class="form-horizontal">

									<div class="control-group">

										<label class="control-label">TIME</label>

										<div class="controls">

											<div name="time" class="input-append date form_meridian_datetime" data-date="2013-02-21T15:25:00Z">

												<input size="16" type="text" value="" readonly="" class="m-wrap">

												<span class="add-on"><i class="icon-remove"></i></span>

												<span class="add-on"><i class="icon-calendar"></i></span>

											</div>

										</div>

									</div>

								</form>

							</div>

							<div class="modal-footer">

								<button name="closetime" class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>

								<button name="savetime" class="btn green btn-primary" data-dismiss="modal">保存设置</button>

							</div>

						</div>
					</div>



				<!-- END FORM-->       

			</div>

		</div>

		<!-- END SAMPLE FORM PORTLET-->

	</div>

</div>
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
var flag1=false;
var flag7=false;
var flag8=false;
$('input[name="pic"]').click(function(){
	$('span[name="NOTE"]').css('display','none');
	$('span[name="notice"]').css('display','none');
});
//c_time
$('button[name="savetime"]').click(function(){
	$('input[name="c_time"]').val($('div[name="time"] input').val());
	if($('input[name="c_time"]').val()==''){
		$('span[name="c_time"]').html('时间设置不能为空').css('color','red');
		flag1=false;
	}else{
		$('span[name="c_time"]').html('&nbsp;');
		flag1=true;
	}
});
$('button[name="closetime"]').click(function(){
	$('input[name="c_time"]').val('');
	if($('input[name="c_time"]').val()==''){
		$('span[name="c_time"]').html('时间设置不能为空').css('color','red');
		flag1=false;
	}else{
		$('span[name="c_time"]').html('&nbsp;');
		flag1=true;
	}
});

//title
$('input[name="title"]').focus(function(){
	$(this).parent().find('span').html('请输入4--20位有效字符').css('color','#ccc');
});
$('input[name="title"]').blur(function(){
	var reg=/^[\u4e00-\u9fa5_a-zA-Z0-9_]{4,20}$/;//匹配4-12位数字字母下划线和中文
	if($(this).val()==''){
		$(this).parent().find('span').html('标题不能为空').css('color','red');
		flag3=false;
	}else if(!reg.test($(this).val())){
		$(this).parent().find('span').html('标题格式不正确，请输入4--20位有效字符').css('color','red');
		flag3=false;
	}else{
		$(this).parent().find('span').html('&nbsp;');
		flag3=true;
	}
});
//status
$('select[name="status"]').focus(function(){
	$(this).parent().find('span').html('请选择轮播图状态').css('color','#ccc');
});
$('select[name="status"]').blur(function(){
	if($(this).val()==''){
		$(this).parent().find('span').html('轮播图状态不能为空').css('color','red');
		flag7=false;
	}else{
		$(this).parent().find('span').html('&nbsp;');
		flag7=true;
	}
});

//auth
$('select[name="auth"]').focus(function(){
	$(this).parent().find('span').html('请选择轮播图位置').css('color','#ccc');
});
$('select[name="auth"]').blur(function(){
	if($(this).val()==''){
		$(this).parent().find('span').html('轮播图位置不能为空').css('color','red');
		flag8=false;
	}else{
		$(this).parent().find('span').html('&nbsp;');
		flag8=true;
	}
});

$('button[name="submit"]').click(function(){
	if(flag1==true&&flag7==true&&flag8==true){
		// alert('true');
		return true;
	}else{
		// alert('false');
		return false;
	}
});
</script>
</block>
